package com.jsmile.cloud.tradecenter.api.res;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.jsmile.cloud.tradecenter.api.res.express.ResOrderExpress;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel
public class ResOrder implements java.io.Serializable {

    @ApiModelProperty(value = "订单编号")
    private Long orderNo;
    @ApiModelProperty(value = "订单类型 1平台订单 2自营订单 3拼团订单 4秒杀订单 5.限时购")
    private Integer orderType;
    @ApiModelProperty(value = "活动id")
    private Long activityId;
    @ApiModelProperty(value = "待支付:1，待发货:2，待签收:3，已完成:4，已关闭:5")
    private Integer orderStatus;
    @ApiModelProperty(value = "实付金额")
    private Long actuallyPayAmount;
    @ApiModelProperty(value = "余额支付金额")
    private Long balanceAmount;
    @ApiModelProperty(value = "折扣金额:优惠券,活动,积分抵扣之和")
    private Long discountAmount;
    @ApiModelProperty(value = "优惠券金额")
    private Long ticketDisamt;
    @ApiModelProperty(value = "商品总金额")
    private Long productAmount;
    @ApiModelProperty(value = "活动优惠金额")
    private Long promotionDisamt;
    @ApiModelProperty(value = "积分抵扣金额")
    private Long pointDisamt;
    @ApiModelProperty(value = "运费")
    private Long logisticsFee;
    @ApiModelProperty(value = "付款方式，1-余额支付  2微信支付  3支付宝支付")
    private Integer payMethod;
    @ApiModelProperty(value = "发货类型：1自提，2快递")
    private Integer deliveryType;
    @ApiModelProperty(value = "下单时间")
    private java.util.Date createTime;
    @ApiModelProperty(value = "支付时间")
    private java.util.Date payTime;
    @ApiModelProperty(value = "发货时间")
    private java.util.Date deliveryTime;
    @ApiModelProperty(value = "完成时间")
    private java.util.Date finishTime;
    @ApiModelProperty(value = "关闭时间")
    private java.util.Date closeTime;
    @ApiModelProperty(value = "取消类型 1用户取消 2商家取消")
    private Integer cancelType;
    @ApiModelProperty(value = "取消原因")
    private String cancelReason;
    @ApiModelProperty(value = "退款标记（0未退款，1退款）")
    private Integer refundFlag;
    @ApiModelProperty(value = "退款时间")
    private Date refundTime;
    @ApiModelProperty(value = "支付备注")
    private String payRemark;
    @ApiModelProperty(value = "订单备注")
    private String orderRemark;
    @ApiModelProperty(value = "付款截止时间")
    private java.util.Date payDeadlineTime;
    @ApiModelProperty(value = "自动收货任务处罚的日期，格式如：20180901")
    private String autoFinishDate;
    @ApiModelProperty(value = "取货码")
    private String orderCode;
    @ApiModelProperty(value = "店铺ID")
    private Long shopId;
    @ApiModelProperty(value = "租户id")
    private Long tenantId;
    @ApiModelProperty(value = "商户id")
    private Long merchantId;
    @ApiModelProperty(value = "供应商id")
    private Long supplyId;
    @ApiModelProperty(value = "第三方订单编号")
    private String thirdOrderNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "订单地址")
    private ResOrderAddress orderAddress;
    @TableField(exist = false)
    @ApiModelProperty(value = "订单优惠")
    private List<ResOrderDiscount> orderDiscounts;
    @TableField(exist = false)
    @ApiModelProperty(value = "订单商品")
    private List<ResOrderProduct> orderProducts;
    @ApiModelProperty(value = "物流信息")
    private List<ResOrderExpress> orderExpresses;

    // TODO 是否可以退款
    public boolean hasRefund() {
        return true;
    }

    // TODO 是否可以取消订单
    public boolean hasCancelOrder() {
        return true;
    }
}
